﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Blade.IO;

namespace Blade.Metadata.CliLoader {
	public struct RVAPair {
		public readonly RVA RVA;
		public readonly uint Size;

		public RVAPair(BinaryReader reader) {
			RVA = new RVA(reader);
			Size = reader.ReadUInt32();
		}

		public override string ToString() {
			return string.Format("0x{0:X8} : 0x{1:X8}", RVA.Value, Size);
		}

		public static bool operator ==(RVAPair a, uint b) {
			if (a.RVA != b)
				return false;
			if (b == 0)
				return a.Size == 0;
			else
				return false;
		}

		public static bool operator !=(RVAPair a, uint b) {
			return !(a == b);
		}

	}
}
